/*
 * @Author: 江舟 jijiangzhou@recycloud.cn
 * @Date: 2024-03-22 14:24:18
 * @LastEditors: 江舟 jijiangzhou@recycloud.cn
 * @LastEditTime: 2024-08-02 10:16:07
 * @LastEditTime: 2024-05-23 17:03:46
 * @FilePath: \vite-project\src\constant\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
export const COMPANY_NAME = '中再资源（宁夏）有限公司';
export const TOKEN_NAME = 'bfcToken';
export const IS_ENCRYPT_NAME = 'bfcPcIsEncrypt';

export const RENT_TYPES_ENUM = {
	all: { text: '全部', type: '' },
	1: {
		text: '企业',
		type: '1',
	},
	2: {
		text: '政府事业单位',
		type: '2',
	},
};

export const RENT_STATUS_ENUM = {
	1: {
		text: '启用',
		type: 1,
	},
	0: {
		text: '禁用',
		type: 0,
	},
};

export const AVAILABLE_ENUM = {
	true: {
		text: '启用',
	},
	false: {
		text: '禁用',
	},
};

export const PRICE_STANDARD_ENUM = {
	1: {
		text: '采购报价',
		type: 1,
	},
	2: {
		text: '销售报价',
		type: 2,
	},
};

export const RENTER_TYPES = [
	{ value: 1, label: '企业' },
	{ value: 2, label: '政府机构' },
];

export const ORG_TYPES = [
	{ value: 1, label: '集团' },
	{ value: 2, label: '公司' },
	{ value: 3, label: '分公司' },
	{ value: 4, label: '事业部' },
	{ value: 5, label: '办事处' },
	{ value: 6, label: '部门' },
	{ value: 7, label: '政府机构' },
];

export const PRICE_TYPES_TYPE: {
	[x: number]: {
		label?: string;
		value?: string | number;
	}[];
} = {
	1: [
		{
			value: 1,
			label: '重量',
		},
	],
	2: [
		{
			value: 2,
			label: '数量',
		},
	],
};

export const EXPRESSIONS_TYPES = [
	{ value: 1, label: '>' },
	{ value: 2, label: '<' },
	{ value: 3, label: '>=' },
	{ value: 4, label: '<=>' },
];

export const PRICE_UNIT_TYPES = [
	{ value: 1, label: '吨/元' },
	{ value: 2, label: '辆/元' },
];

export const PRICE_SPECIFICATION_UNIT_TYPES: {
	[x: number]: {
		label?: string;
		value?: string | number;
	}[];
} = {
	1: [
		{
			value: 1,
			label: 'kg',
		},
	],
	2: [
		{
			value: 2,
			label: '辆',
		},
	],
};

// 供应商
export const MERCHANT_TYPES = [
	{
		value: 1,
		label: '个人',
	},
	{
		value: 2,
		label: '企业',
	},
	{
		value: 3,
		label: '政府事业单位',
	},
];

export const MERCHANT_USER_TYPES = [
	{
		value: 1,
		label: '中间商',
	},
	{
		value: 2,
		label: '车主',
	},
];

export const MERCHANT_TYPES_ENUM: {
	[x: number]: {
		text: string;
		type: number;
	};
} = {
	1: {
		text: '个人',
		type: 1,
	},
	2: {
		text: '企业',
		type: 2,
	},
	3: {
		text: '政府事业单位',
		type: 3,
	},
};

// 合同
// 1-采购合同 、2-销售合同 、3-拍卖竞标协议 、 4-其他合同
export const CONTRACT_TYPES_ENUM = {
	1: {
		text: '采购合同',
		type: 1,
	},
	2: {
		text: '销售合同',
		type: 2,
	},
	3: {
		text: '拍卖竞标协议',
		type: 3,
	},
	4: {
		text: '其他合同',
		type: 4,
	},
};
// 1-未开始 、2-生效中 、3-已过期 、4-已作废
export const CONTRACT_STATUS_ENUM = {
	1: {
		text: '未开始',
		type: 1,
	},
	2: {
		text: '生效中',
		type: 2,
	},
	3: {
		text: '已过期',
		type: 3,
	},
	4: {
		text: '已作废',
		type: 4,
	},
};

export const CONTRACT_TYPES = [
	{
		label: '采购合同',
		value: 1,
	},
	{
		label: '销售合同',
		value: 2,
	},
	{
		label: '拍卖竞标协议',
		value: 3,
	},
	{
		label: '其他合同',
		value: 4,
	},
];

// 收车管理
// 1-报价成功 、2-报价失败 、3-等待反馈 、4-草稿
export const RECYCLE_INQUIRY_TYPES = [
	{
		label: '草稿',
		value: 1,
	},
	{
		label: '等待反馈',
		value: 2,
	},
	{
		label: '报价成功',
		value: 3,
	},
	{
		label: '报价失败',
		value: 4,
	},
];
export const RECYCLE_INQUIRY_TYPES_ENUM: {
	[x: number]: any;
} = {};
RECYCLE_INQUIRY_TYPES.map(item => {
	RECYCLE_INQUIRY_TYPES_ENUM[item.value] = {
		text: item?.label,
	};
});

// 车辆来源：1-私家车 、2-公家车 、3-招标拍卖车
export const RECYCLE_CAR_SOURCE_TYPES = [
	{
		label: '私家车',
		value: 1,
	},
	{
		label: '公家车',
		value: 2,
	},
	{
		label: '招标拍卖车',
		value: 3,
	},
];
export const RECYCLE_CAR_SOURCE_TYPES_ENUM: {
	[x: number]: any;
} = {};
RECYCLE_CAR_SOURCE_TYPES.map(item => {
	RECYCLE_CAR_SOURCE_TYPES_ENUM[item.value] = {
		text: item?.label,
	};
});

// 回用件
// 1-汽车 、2-摩托车
export const RESUABLE_TYPES = [
	{
		label: '汽车',
		value: 1,
	},
	{
		label: '摩托车',
		value: 2,
	},
];

// 价值评分
export const RECYCLE_CAR_SCORE = [
	{
		label: '缺失',
		value: 'lackScore',
	},
	{
		label: '有损坏',
		value: 'damageScore',
	},
	{
		label: '有瑕疵',
		value: 'defectiveScore',
	},
	{
		label: '完好',
		value: 'intactScore',
	},
];

export const RECYCLE_CAR_SCORE_ENUM: {
	[x: string]: any;
} = {};
RECYCLE_CAR_SCORE.map(item => {
	RECYCLE_CAR_SCORE_ENUM[item.value] = {
		text: item?.label,
	};
});

export const MENU_TYPE_ENUM = {
	1: {
		text: '目录',
		type: 1,
	},
	2: {
		text: '菜单',
		type: 2,
	},
	3: {
		text: '按钮',
		type: 3,
	},
};

export const MENU_MODULE_TYPE_ENUM = {
	1: {
		text: 'PC',
		type: 1,
	},
	2: {
		text: '移动',
		type: 2,
	},
};

// 监销状态
export const SUPERVISION_TYPE = [
	{
		label: '待监销',
		value: 1,
	},
	{
		label: '监销通过',
		value: 2,
	},
	{
		label: '监销不通过',
		value: 3,
	},
];
export const SUPERVISION_TYPE_ENUM: {
	[x: string]: any;
} = {};
SUPERVISION_TYPE.map((item: { value: string | number; label: any }) => {
	SUPERVISION_TYPE_ENUM[item.value] = {
		text: item?.label,
	};
});

// 作业状态
export const CERTIFICATE_TYPE = [
	{
		label: '待开具证明',
		value: 1,
	},
	{
		label: '开具证明通过',
		value: 2,
	},
	{
		label: '开具证明不通过',
		value: 3,
	},
];
export const CERTIFICATE_TYPE_ENUM: {
	[x: string]: any;
} = {};
CERTIFICATE_TYPE.map((item: { value: string | number; label: any }) => {
	CERTIFICATE_TYPE_ENUM[item.value] = {
		text: item?.label,
	};
});

// 销户状态
export const CANCELLATION_TYPE = [
	{
		label: '待销户',
		value: 1,
	},
	{
		label: '销户通过',
		value: 2,
	},
	{
		label: '销户不通过',
		value: 3,
	},
];
export const CANCELLATION_TYPE_ENUM: {
	[x: string]: any;
} = {};
CANCELLATION_TYPE.map((item: { value: string | number; label: any }) => {
	CANCELLATION_TYPE_ENUM[item.value] = {
		text: item?.label,
	};
});

// 证件缺失
export const CREDENTINAAL_TAG_TYPE = [
	{
		label: '不缺失',
		value: 1,
	},
	{
		label: '缺失',
		value: 2,
	},
];
export const CREDENTINAAL_TAG_TYPE_ENUM: {
	[x: string]: any;
} = {};
CREDENTINAAL_TAG_TYPE.map((item: { value: string | number; label: any }) => {
	CREDENTINAAL_TAG_TYPE_ENUM[item.value] = {
		text: item?.label,
	};
});

// 质检
// 1-草稿 ；2-已质检 ；3 已签署 ；4-已确认
export const INSPECTION_TYPES = [
	{
		label: '草稿',
		value: 1,
	},
	{
		label: '已质检',
		value: 2,
	},
	// {
	// 	label: '已签署',
	// 	value: 3,
	// },
	{
		label: '已确认',
		value: 4,
	},
];
export const INSPECTION_TYPES_ENUM: {
	[x: string]: any;
} = {};
INSPECTION_TYPES.map((item: { value: string | number; label: any }) => {
	INSPECTION_TYPES_ENUM[item.value] = {
		text: item?.label,
	};
});

// 入库
export const PURCHASE_WARE_HOUSE_IN_TYPES: {
	label: string;
	value: string | number;
}[] = [
	{
		label: '全部',
		value: '',
	},
	{
		label: '待入库',
		value: 1,
	},
	{
		label: '部分入库',
		value: 2,
	},
	{
		label: '已入库',
		value: 3,
	},
];

export const PURCHASE_WARE_HOUSE_IN_TYPES_ENUM: {
	[x: string | number]: any;
} = {};
PURCHASE_WARE_HOUSE_IN_TYPES?.map(item => {
	if (item?.value) {
		PURCHASE_WARE_HOUSE_IN_TYPES_ENUM[item.value] = {
			text: item?.label,
		};
	}
});

export const MATERIALS_TYPES: {
	label: string;
	value: string | number;
}[] = [
	{
		label: '草稿',
		value: 1,
	},
	{
		label: '待进场',
		value: 2,
	},
	{
		label: '已进场',
		value: 3,
	},
	{
		label: '已质检',
		value: 4,
	},
	{
		label: '已确认',
		value: 5,
	},
	{
		label: '待入库',
		value: 6,
	},
	{
		label: '已入库',
		value: 7,
	},
	{
		label: '已完成',
		value: 8,
	},
];
export const MATERIALS_TYPES_ENUM: {
	[x: string | number]: string;
} = {};
MATERIALS_TYPES?.map(item => {
	if (item?.value) {
		MATERIALS_TYPES_ENUM[item.value] = item?.label;
	}
});

// 库区类型
// 1-整车库区 、2-拆解产物库区 、3-拆解产物危废库区 、4-拆解产物回用件库区
export const FACTORY_STORAGE_TYPES = [
	{
		label: '整车库区',
		value: 1,
	},
	{
		label: '拆解产物库区',
		value: 2,
	},
	{
		label: '拆解产物危废库区',
		value: 3,
	},
	{
		label: '拆解产物回用件库区',
		value: 3,
	},
];
export const FACTORY_STORAGE_TYPES_ENUM: {
	[x: number]: any;
} = {};
FACTORY_STORAGE_TYPES.map(item => {
	FACTORY_STORAGE_TYPES_ENUM[item.value] = {
		text: item?.label,
	};
});

// 储位类型
// 1-料架 、2-料垛
export const STORAGE_POSITION_TYPES = [
	{
		label: '料架',
		value: 1,
	},
	{
		label: '料垛',
		value: 2,
	},
];
export const STORAGE_POSITION_TYPES_ENUM: {
	[x: number]: any;
} = {};
STORAGE_POSITION_TYPES.map(item => {
	STORAGE_POSITION_TYPES_ENUM[item.value] = {
		text: item?.label,
	};
});

// 拆解计划状态
// 拆解状态：1-已分解 、2、 已作废 、3- 进行中 、4-已完成
export const DECOMPOSITION_PLAN_STATUS = [
	{
		label: '已分解',
		value: 1,
	},
	{
		label: '已作废',
		value: 2,
	},
	{
		label: '进行中',
		value: 3,
	},
	{
		label: '已完成',
		value: 4,
	},
];
export const DECOMPOSITION_PLAN_STATUS_ENUM: {
	[x: number]: any;
} = {};
DECOMPOSITION_PLAN_STATUS.map(item => {
	DECOMPOSITION_PLAN_STATUS_ENUM[item.value] = {
		text: item?.label,
	};
});

// 工单详情单条状态
// 工单状态：1-未开始 ；2-进行中 ；3-已完成 ；4-已作废
export const WORK_SPLIT_ITEM_STATUS = [
	{
		label: '未开始',
		value: 1,
	},
	{
		label: '进行中',
		value: 2,
	},
	{
		label: '已完成',
		value: 3,
	},
	{
		label: '已作废',
		value: 4,
	},
];
export const WORK_SPLIT_ITEM_STATUS_ENUM: {
	[x: number]: any;
} = {};
WORK_SPLIT_ITEM_STATUS.map(item => {
	WORK_SPLIT_ITEM_STATUS_ENUM[item.value] = {
		text: item?.label,
	};
});

// 拆解产品：1-报废车
export const DECOMPOSITION_PRODUCT_TYPE = [
	{
		label: '报废车',
		value: 1,
	},
];
export const DECOMPOSITION_PRODUCT_TYPE_ENUM: {
	[x: number]: any;
} = {};
DECOMPOSITION_PRODUCT_TYPE.map(item => {
	DECOMPOSITION_PRODUCT_TYPE_ENUM[item.value] = {
		text: item?.label,
	};
});

// 清单类别
// 1-回用件、2-危废产物、3-原材料产物
export const BOM_TYPE = [
	{
		label: '回用件',
		value: 1,
	},
];
export const BOM_TYPE_ENUM: {
	[x: number]: any;
} = {};
BOM_TYPE.map(item => {
	BOM_TYPE_ENUM[item.value] = {
		text: item?.label,
	};
});

// 结算单状态
// 1-待审核、2-审核通过 、3-审核失败 、4-结算中 、5-已结算 、6-已作废
export const PAYABLE_TYPE = [
	{
		label: '全部',
		value: 'all',
		key: 'all',
	},
	{
		label: '待审核',
		value: 1,
		key: '1',
	},
	// {
	// 	label: '审核通过',
	// 	value: 2,
	// 	key: '2',
	// },
	{
		label: '审核失败',
		value: 3,
		key: '3',
	},
	{
		label: '结算中',
		value: 4,
		key: '4',
	},
	{
		label: '已结算',
		value: 5,
		key: '5',
	},
	{
		label: '已作废',
		value: 6,
		key: '6',
	},
];
export const PAYABLE_TYPE_ENUM: {
	[x: number]: any;
} = {};
PAYABLE_TYPE.map((item: { value: string | number; label: any }) => {
	PAYABLE_TYPE_ENUM[item.value] = {
		text: item?.label,
	};
});

// 发票类型
export const INVOICE_TYPE = [
	{
		label: '增值税普通发票',
		value: 1,
	},
	{
		label: '增值税专用发票',
		value: 2,
	},
];
